﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Resto.CostControl.Core.Facade.SiteModule.DataTransferObject;
using Resto.CostControl.Core.Cache;
using Resto.CostControl.Core.Facade.DishOrderModule.DataTransferObject;
using Resto.CostControl.Core.Enums;

namespace Resto.CostControl.Core.Query.DishOrderModule.ViewObject
{
    [Serializable]
    public class DishOrderVO
    {
        #region 基本属性

        public string ID { get; set; }

        /// <summary>
        /// 订购日期
        /// </summary>
        public DateTime OrderDate { get; set; }

        /// <summary>
        /// 项目点Id
        /// </summary>
        public string SiteId { get; set; }

        /// <summary>
        /// 项目点名称
        /// </summary>
        public string SiteName
        {
            get
            {
                SiteDTO siteDTO = SiteDTOCache.Get(SiteId);
                if (siteDTO != null)
                    return siteDTO.Name;
                else
                    return string.Empty;
            }
        }

        /// <summary>
        /// 成本总计
        /// </summary>
        public decimal TotalCost {get;set;}
       

        /// <summary>
        /// 售价总计
        /// </summary>
        public decimal TotalPrice {get;set;}


        /// <summary>
        /// 订单类型
        /// </summary>
        internal string OrderTypeCode { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        internal string OrderStateCode { get; set; }

        /// <summary>
        /// 订单类型
        /// </summary>
        public DishOrderType OrderType
        {
            get
            {
                return (DishOrderType)Enum.Parse(typeof(DishOrderType), this.OrderTypeCode);
            }
        }

        /// <summary>
        /// 订单状态
        /// </summary>
        public DishOrderState OrderState
        {
            get
            {
                return (DishOrderState)Enum.Parse(typeof(DishOrderState), this.OrderStateCode);
            }
        }

        #endregion
    }
}
